home *** CD-ROM | disk | FTP | other *** search
- // ******************************************************************
- //
- // pictdlg.cpp : implementation file
- //
- // Implemented classes:
- // CShowPictDlg
- //
- // Author: POET Software, August 1993
- //
- // ******************************************************************
-
- #include <stdafx.h> // header to MFC
- #include <pictdlg.h> // header to this file
-
- #ifdef _DEBUG // added by ClassWizard
- #undef THIS_FILE
- static char BASED_CODE THIS_FILE[] = __FILE__;
- #endif
-
-
-
-
- /////////////////////////////////////////////////////////////////////////////
- // CShowPictDlg dialog
-
- CShowPictDlg::CShowPictDlg(CWnd* pParent, PtBlob *pBlob)
- : CDialog(CShowPictDlg::IDD, pParent)
- {
- m_pBlob = pBlob; // set Blob
-
- //{{AFX_DATA_INIT(CShowPictDlg)
- // NOTE: the ClassWizard will add member initialization here
- //}}AFX_DATA_INIT
- }
-
-
-
- void CShowPictDlg::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CShowPictDlg)
- // NOTE: the ClassWizard will add DDX and DDV calls here
- //}}AFX_DATA_MAP
- }
-
- void CShowPictDlg::Init ()
- {
- m_Bitmap.Setup (this, m_pBlob); // load bitmap from Blob
-
- int frameWidth, frameHeight, captionHeight;
- // adjust DialogWindow
- frameWidth = GetSystemMetrics(SM_CXDLGFRAME) * 2;
- frameHeight = GetSystemMetrics(SM_CYDLGFRAME);
- captionHeight = GetSystemMetrics(SM_CYCAPTION);
- MoveWindow(40, 40, // set correct metrics to dialogwindow
- m_Bitmap.GetBMWidth () + frameWidth,
- m_Bitmap.GetBMHeight () + captionHeight + frameHeight);
- }
-
- BEGIN_MESSAGE_MAP(CShowPictDlg, CDialog)
- //{{AFX_MSG_MAP(CShowPictDlg)
- ON_WM_PAINT()
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
-
- /////////////////////////////////////////////////////////////////////////////
- // CShowPictDlg message handlers
-
- void CShowPictDlg::OnPaint()
- {
- CPaintDC dc(this); // device context for painting
-
- m_Bitmap.Draw (&dc, 0, 0); // paint bitmap
-
- // Do not call CDialog::OnPaint() for painting messages
- }
-
- BOOL CShowPictDlg::OnInitDialog()
- {
- CDialog::OnInitDialog();
-
- Init (); // load bitmap from Blob
-
- return TRUE; // return TRUE unless you set the focus to a control
- }
-